package com.train.member.enums;

import cn.hutool.core.util.ArrayUtil;
import com.train.common.enums.Enums;

public enum PassengerTypeEnums implements Enums {
    //乘客类型
    AD(1, "成人"),
    CH(2, "儿童"),
    ST(3, "学生"),;

    private final Integer code;

    private final String message;

    PassengerTypeEnums(Integer code, String message) {
        this.code = code;
        this.message = message;
    }


    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }


    public static Enums getByCode(Integer code) {
        return ArrayUtil.firstMatch(item -> item.getCode().equals(code), values());
    }
}
